package com.zkthink.ceres.applet.pcSetting.controller;

import com.zkthink.base.R;
import com.zkthink.ceres.applet.pcSetting.domain.entry.PcSetting;
import com.zkthink.ceres.applet.pcSetting.domain.vo.PcSettingVo;
import com.zkthink.ceres.applet.pcSetting.service.PcSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author cmz
 * @Date 2024-05-14 9:40
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/applet/pcSetting")
@Api(value = "规则协议", tags = "规则协议")
public class PcSettingController {
    @Autowired
    private PcSettingService pcSettingService;
    
    @GetMapping("/getShareSetting/{settingType}")
    @ApiOperation("根据类型获取最新的协议规则")
    public R<PcSettingVo> getShareSetting(@ApiParam("类型(1用户政策2隐私协议3vip规则4分享规则5关于)") @PathVariable Integer settingType){
        return pcSettingService.selectOneNewSettingByType(settingType);
    }
}
